<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main" />
    <g:set var="entityName" value="${message(code: 'jasperFile.label', default: 'JasperFile')}" />
    <title>下载模板</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>贷款管理系统</li>
                    <li class="active">
                        <span>下载模板</span>
                    </li>
                </ol>
            </div>
            <h2 class="font-light m-b-xs">
                下载模板
            </h2>
        </div>
    </div>
</div>
<div class="content animate-panel">
    <div class="row">
        %{--<g:form method="POST" action="searchJasperFile">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn"><i class="fa fa-times"></i>重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body">
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="下载模板名称" name="name" id="name" value="${params?.name}">
                    </div>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="所属区域" name="district" id="district" value="${params?.district}">
                    </div>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="所属城市" name="city" id="city" value="${params?.city}">
                    </div>
                </div>
            </div>
        </g:form>--}%
        <g:if test="${flash.message}">
            <div class="row">
                <div class="hpanel">
                    <div class="panel-body">
                        <div class="alert alert-info" role="alert">${flash.message}</div>
                    </div>
                </div>
            </div>
        </g:if>
    </div>
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link action="create" class="btn btn-info btn-xs"><i class="fa fa-plus"></i>新建</g:link>
                </div>
                所有下载模板
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="name" title="${message(code: 'jasperFile.name.label', default: '下载模板名称')}" />
                            <g:sortableColumn property="description" title="${message(code: 'jasperFile.description.label', default: '模板描述')}" />
                            <g:sortableColumn property="component" title="${message(code: 'jasperFile.component.name.label', default: '关联组件')}" />
                            <g:sortableColumn property="fileUrl" title="${message(code: 'jasperFile.fileUrl.label', default: '模板路径')}" />
                            <g:sortableColumn property="createdDate" title="${message(code: 'jasperFile.createdDate.label', default: '创建时间')}" />
                            <g:sortableColumn property="modifiedDate" title="${message(code: 'jasperFile.modifiedDate.label', default: '修改时间')}" />
                            <g:sortableColumn colspan="2" property="modifiedDate" title="${message(code: 'jasperFile.modifiedDate.label', default: '操作')}" />
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${jasperFileList}">
                            <tr>
                                <td>
                                    <g:link action="show" id="${it.id}" class="firstTd">${it.name}</g:link>
                                </td>
                                <td>${it.description}</td>
                                <td>${it.component?.name}</td>
                                <td>${it.fileUrl}</td>
                                <td><g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${it.createdDate}"/></td>
                                <td><g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${it.modifiedDate}"/></td>
                                <td><g:link target="_blank" class="btn btn-outline btn-primary" controller="jasperFile" action="downloadJasperReport" id="${it.id}" params="[format:'HTML']">html页面展示</g:link></td>
                                <td><g:link target="_blank" class="btn btn-outline btn-primary" controller="jasperFile" action="downloadJasperReport" id="${it.id}" params="[format:'PDF']">pdf下载</g:link></td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${jasperFileCount ?: 0}" params="${params}" />
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
